
var vm = new Vue ({
    el:"#app",
    data:{
        message :"正在加载中…"
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.employees))
            .catch (function (error) {
                console.log(error);
            })
    }
})



var duo1 = document.querySelector(".duo1");
var  n3y = document.querySelector(".n3-y")

duo1.addEventListener("mouseover",function () {

    n3y.style.display = "block"
})

duo1.addEventListener("mouseleave",function () {

    n3y.style.display = "none"
})
n3y.addEventListener("mouseover",function () {
    n3y.style.display = "block"
})
n3y.addEventListener("mouseleave",function () {
    n3y.style.display = "none"
})

var duo2 = document.querySelector(".duo2");
var  n4y = document.querySelector(".n4-y")

duo2.addEventListener("mouseover",function () {

    n4y.style.display = "block"
})

duo2.addEventListener("mouseleave",function () {
    n4y.style.display = "none"
})
n4y.addEventListener("mouseover",function () {
    n4y.style.display = "block"
})
n4y.addEventListener("mouseleave",function () {
    n4y.style.display = "none"
})

var duo3 = document.querySelector(".duo3");
var  n5y = document.querySelector(".n5-y")

duo3.addEventListener("mouseover",function () {
    n5y.style.display = "block"
})

duo3.addEventListener("mouseleave",function () {
    n5y.style.display = "none"
})

n5y.addEventListener("mouseover",function () {
    n5y.style.display = "block"
})
n5y.addEventListener("mouseleave",function () {
    n5y.style.display = "none"
})

// var x= document.querySelector(".head-le>img");
// var z= document.querySelector(".zai");
//
//
// function dian(a) {
//     if (a==1){
//         x.style.display="block";
//         z.style.display="none";
//     }else {
//         x.style.display="none";
//         z.style.display="block";
//     }
// };
//
new Vue({
    el:'#min',
    data:{

        ming:[
            'LOL','CF','DNF','炉石传说','CS:GO'
        ],

        mingl:[
            '绝地求生','主机游戏','我的世界','怀旧游戏'
        ],

        mingll:[
            '星秀','户外','二次元','美食','颜值'
        ],

        minglll:[
            '王者荣耀','和平精英','CF手游'
        ]
    }
});


var hu=document.querySelectorAll(".ul1 li");
var x= document.querySelectorAll(".head-le .huan");
// var z= document.querySelector(".zai");

for (var i=0;i<hu.length;i++){

    hu[i].index = i;
    hu[i].addEventListener("click",function () {
        for(var q=0;q<hu.length;q++){
            hu[q].classList.remove("huang");
        }
        for(var q=0;q<x.length;q++){
            x[q].classList.remove("block")
        }

        hu[this.index].classList.add("huang");
        x[this.index].classList.add("block");
    })
};

var la = document.querySelector(".liii div")
var im = document.querySelector(".liii img")
var ka = document.querySelector(".ce-top img")

la.addEventListener("mouseenter",function () {
    im.style.right = "50px";
    ka.style.display="none"
});
la.addEventListener("mouseleave",function () {
    im.style.right = "-250px";
    ka.style.display="block"
});
im.addEventListener("mouseenter",function () {
    im.style.right = "50px";
    ka.style.display="none"
});
im.addEventListener("mouseleave",function () {
    im.style.right = "-250px";
    ka.style.display="block"
});

var t=document.querySelector("#toTop");

t.addEventListener('click',function(){
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})

var w=document.querySelector("#toSh");
var oo=document.querySelector(".ji-ce div");
var  sh=document.querySelector(".shang nav")

window.onscroll = function () {

    if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800){
        oo.style.display ="block";
        sh.style.top ="0px";
        t.style.display ="block";
    }else {
        oo.style.display ="none";
        sh.style.top ="-100px";
        t.style.display ="none";
    }
};
w.addEventListener('click',function(){
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});

var jm=document.querySelectorAll(".jmd .jm1");

for (var f=0;f<jm.length;f++){
    jm[f].index=f;
jm[f].addEventListener('mouseenter',function () {

        for (var g=0;g<jm.length;g++){
            jm[g].classList.remove("jmx");
            jm[this.index].classList.add("jmx");
        }
    })
};


//
//
//window.onscroll = function () {
//
//    if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800){
//        sh.style.top ="0px";
//    }else {
//        sh.style.top ="-100px";
//    }
//};
// var  sh=document.querySelector(".shang nav")


// window.onscroll = function () {

//     if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800){
//         sh.style.top ="0px";
//     }else {
//         sh.style.top ="-100px";
//     }
// };




var y=document.querySelector(".dayin");
var z=document.querySelector(".souyin");

var a=0;
    y.addEventListener('click',function () {
        a++;
        if(a==2){
            a=0
        }
        if(a==1){
            z.style.height="40px"
        }else{
            z.style.height="0px"
        }
    });

var duo11 = document.querySelector(".shang .duo1");
var  n3y1 = document.querySelector(".shang .n3-y")

duo11.addEventListener("mouseover",function () {

    n3y1.style.display = "block"
})

duo11.addEventListener("mouseleave",function () {

    n3y1.style.display = "none"
})
n3y1.addEventListener("mouseover",function () {
    n3y1.style.display = "block"
})
n3y1.addEventListener("mouseleave",function () {
    n3y1.style.display = "none"
})

var duo22 = document.querySelector(".shang .duo2");
var  n4y2 = document.querySelector(".shang .n4-y")

duo22.addEventListener("mouseover",function () {
    n4y2.style.display = "block"
})

duo22.addEventListener("mouseleave",function () {
    n4y2.style.display = "none"
})
n4y2.addEventListener("mouseover",function () {
    n4y2.style.display = "block"
})
n4y2.addEventListener("mouseleave",function () {
    n4y2.style.display = "none"
})

var duo33 = document.querySelector(".shang .duo3");
var  n5y3 = document.querySelector(".shang .n5-y")

duo33.addEventListener("mouseover",function () {
    n5y3.style.display = "block"
})

duo33.addEventListener("mouseleave",function () {
    n5y3.style.display = "none"
})

n5y3.addEventListener("mouseover",function () {
    n5y3.style.display = "block"
})
n5y3.addEventListener("mouseleave",function () {
    n5y3.style.display = "none"
})


var hnt=document.querySelectorAll(".ulq li");
var hnb=document.querySelectorAll(".hn-bottom ul");
var kai=document.querySelector(".kaiguan");

for (var l=0;l<hnt.length;l++){
    hnt[l].classList.remove("ban");
    hnb[l].classList.remove("ulx")
}

var b=0;
for (var l=0;l<hnt.length;l++){
    hnt[l].index=l;
    hnt[l].addEventListener('click',function () {
        for(var o=0;o<hnt.length;o++){
            hnt[o].classList.remove("ban");
            hnb[o].classList.remove("ulx");
            hnt[this.index].classList.add("ban");
            hnb[this.index].classList.add("ulx");

        }
        b=1
        kai.classList.add("linyige");
    })
}

kai.addEventListener('click',function () {
    b++;
    if (b == 2) {
        b = 0
    }
    if (b==1){
        for (var l=0;l<hnt.length;l++){
            hnt[0].classList.add("ban");
            hnb[0].classList.add("ulx");
            kai.classList.add("linyige")
        }
    }else {
        for (var l=0;l<hnt.length;l++){
            hnt[l].classList.remove("ban");
            hnb[l].classList.remove("ulx");
            kai.classList.remove("linyige")
        }
    }
});





